/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.struts2.json.annotations.JSON;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "t_submenus")
//@NamedQueries({@NamedQuery(name = "TSubmenus.findAll", query = "SELECT t FROM TSubmenus t"), @NamedQuery(name = "TSubmenus.findBySubmenuId", query = "SELECT t FROM TSubmenus t WHERE t.submenuId = :submenuId"), @NamedQuery(name = "TSubmenus.findByMainmenuId", query = "SELECT t FROM TSubmenus t WHERE t.mainmenuId = :mainmenuId"), @NamedQuery(name = "TSubmenus.findBySubmenuName", query = "SELECT t FROM TSubmenus t WHERE t.submenuName = :submenuName"), @NamedQuery(name = "TSubmenus.findByCtrlUrl", query = "SELECT t FROM TSubmenus t WHERE t.ctrlUrl = :ctrlUrl"), @NamedQuery(name = "TSubmenus.findByIsUse", query = "SELECT t FROM TSubmenus t WHERE t.isUse = :isUse"), @NamedQuery(name = "TSubmenus.findByCtrlDate", query = "SELECT t FROM TSubmenus t WHERE t.ctrlDate = :ctrlDate"), @NamedQuery(name = "TSubmenus.findByTarget", query = "SELECT t FROM TSubmenus t WHERE t.target = :target"), @NamedQuery(name = "TSubmenus.findByAction", query = "SELECT t FROM TSubmenus t WHERE t.action = :action"), @NamedQuery(name = "TSubmenus.findByRequest", query = "SELECT t FROM TSubmenus t WHERE t.request = :request"), @NamedQuery(name = "TSubmenus.findByOrderid", query = "SELECT t FROM TSubmenus t WHERE t.orderid = :orderid")})
public class TSubmenus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "submenu_id")
    private String submenuId;
    @Column(name = "mainmenu_id")
    private String mainmenuId;
    @Basic(optional = false)
    @Column(name = "submenu_name")
    private String submenuName;
    @Basic(optional = false)
    @Column(name = "ctrl_url")
    private String ctrlUrl;
    @Column(name = "is_use")
    private String isUse;
    @Column(name = "ctrl_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ctrlDate;
    @Column(name = "target")
    private String target;
    @Column(name = "action")
    private String action;
    @Column(name = "request")
    private String request;
    @Column(name = "orderid")
    private Short orderid;

    public TSubmenus() {
    }

    public TSubmenus(String submenuId) {
        this.submenuId = submenuId;
    }

    public TSubmenus(String submenuId, String submenuName, String ctrlUrl) {
        this.submenuId = submenuId;
        this.submenuName = submenuName;
        this.ctrlUrl = ctrlUrl;
    }

    public String getSubmenuId() {
        return submenuId;
    }

    public void setSubmenuId(String submenuId) {
        this.submenuId = submenuId;
    }

    public String getMainmenuId() {
        return mainmenuId;
    }

    public void setMainmenuId(String mainmenuId) {
        this.mainmenuId = mainmenuId;
    }

    public String getSubmenuName() {
        return submenuName;
    }

    public void setSubmenuName(String submenuName) {
        this.submenuName = submenuName;
    }

    public String getCtrlUrl() {
        return ctrlUrl;
    }

    public void setCtrlUrl(String ctrlUrl) {
        this.ctrlUrl = ctrlUrl;
    }

    public String getIsUse() {
        return isUse;
    }

    public void setIsUse(String isUse) {
        this.isUse = isUse;
    }

	@JSON(format="yyyy-MM-dd HH:mm:ss")
    public Date getCtrlDate() {
        return ctrlDate;
    }

    public void setCtrlDate(Date ctrlDate) {
        this.ctrlDate = ctrlDate;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    public Short getOrderid() {
        return orderid;
    }

    public void setOrderid(Short orderid) {
        this.orderid = orderid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (submenuId != null ? submenuId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TSubmenus)) {
            return false;
        }
        TSubmenus other = (TSubmenus) object;
        if ((this.submenuId == null && other.submenuId != null) || (this.submenuId != null && !this.submenuId.equals(other.submenuId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.TSubmenus[submenuId=" + submenuId + "]";
    }

}
